\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The two files are compared. (If file1 is `-', the standard input is used.) Under default options, cmp makes no comment if the files are the same; if they differ, it announces the byte and line number at which the difference occurred. If one file is an initial subsequence of the other, that fact is noted.
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Print the byte number (decimal) and the differing bytes (octal) for each difference
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Print nothing for differing files; return codes only
CommandArgument
file1
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The first file to be compared
file2
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The second file to be compared
1select or reject lines common to two sorted files
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b\i0\ulnone\fs24\fc0\cf0 comm
\b0 reads file1 and file2, which should be ordered in ASCII collating sequence, and produces a three column output: lines only in file1; lines only in file2; and lines in both files. The filename `-' means the standard input.
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Prints only the lines common to the two files
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Prints only lines in the first file but not in the second
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The first file to be checked for common lines
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The second file to be checked for common lines
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 If both arguments are directories,
\b diff
\b0 sorts the contents of the directories by name, and then runs the regular file diff algorithm (described below) on text files which are different. Binary files which differ, common subdirectories, and files which appear in only one directory are listed.
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Long output format; each text file diff is piped through pr(1) to paginate it, other differences are remembered and summarized after all text file differences are reported
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Causes application of diff recursively to common subdirectories encountered
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Causes diff to report files which are the same, which are otherwise not mentioned
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Produces a script of a, c and d commands for the editor ed, which will recreate file2 from file1. In connection with -e, the following shell program may help maintain multiple versions of a file. Only an ancestral file ($1) and a chain of version-to-version ed scripts ($2,$3,...) made by diff need be on hand
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Produces a script similar to that of -e, not useful with ed, and in the opposite order
T{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Produces a script similar to that of -e, but in the opposite order and with a count of changed lines on each insert or delete command. This is the form used by rcsdiff(1)
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Produces a diff with lines of context. The default is to present 3 lines of context and may be changed, e.g to 10, by -c10. With -c the output format is modified slightly: the output beginning with identification of the files involved and their creation dates and then each change is separated by a line with a dozen *'s. The lines removed from file1 are marked with `'; those added to file2 are marked `+ '. Lines which are changed from one file to the other are marked in both files with with `! '
6{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Does a fast, half-hearted job. It works only when changed stretches are short and well separated, but does work on files of unlimited length
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Causes trailing blanks (spaces and tabs) to be ignored, and other strings of blanks to compare equal
4{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Is similar to -b but causes whitespace (blanks and tabs) to be totally ignored. E.g., ``if ( a == b )'' will compare equal to ``if(a==b)''
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Ignores the case of letters. E.g., ``A'' will compare equal to ``a''
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Will expand tabs in output lines. Normal or -c output adds character(s) to the front of each line which may screw up the indentation of the original source lines and make the output listing difficult to interpret. This option will preserve the original source's indentation
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The first directory to use for comparison
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The second directory to use for comparison
\b0 runs the regular file diff algorithm (described below) on text files which are different. Binary files which differ, common subdirectories, and files which appear in only one directory are listed.
q{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Forces diff to compare non-binary files containing characters (such as diacriticals and special symbols) that have the 8th bit on; otherwise, diff treats such files as binary and refuses to diff them
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The first file to compare
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The second file to compare
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Causes diff to create a merged version of file1 and file2 on the standard output, with C preprocessor controls included so that a compilation of the result without defining string is equivalent to compiling file1, while defining string will yield file2
string
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 Defining string to yield file2
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Starts a directory diff in the middle beginning with file name
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 The file name to begin starting a directory diff
\b0 compares three versions of a file, and publishes disagreeing ranges of text flagged with these codes: ==== all three files differ ====1 file1 is different ====2 file2 is different ====3 file3 is different The type of change suffered in converting a given range of a given file to some other is indicated in one of these ways: f : n1 a Text is to be appended after line number n1 in file f, where f = 1, 2, or 3. f : n1 , n2 c Text is to be changed in the range line n1 to line n2. If n1 = n2, the range may be abbreviated to n1. The original contents of the range follows immediately after a c indication. When the contents of two files are identical, the contents of the lower-numbered file is suppressed.
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Publishes a script for the editor ed that will incorporate into file1 all changes between file2 and file3
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Produces a script to incorporate only changes flagged ==== (====3)
number
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Treat overlapping changes (i.e., changes that would be flagged with ==== in the normal listing) differently. The overlapping lines from both files will be inserted by the edit script, bracketed by "<<<<<<" and ">>>>>>" lines
\b0 reads the input file comparing adjacent lines. In the normal case, the second and succeeding copies of repeated lines are removed; the remainder is written on the output file. Note that repeated lines must be adjacent in order to be found; see sort(1).
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 The lines that are not repeated in the original file are output
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Specifies that one copy of just the repeated lines is to be written
8{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 Supersedes -u and -d and generates an output report in default style but with each line preceded by a count of the number of times it occurred
^{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 The first n fields together with any blanks before each are ignored. A field is defined as a string of non-space, non-tab characters separated by tabs and spaces from its neighbors
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The number of fields together to skip
\pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 The first n characters are ignored. Fields are skipped before characters
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The number of characters to skip
input
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The input file to compare adjacent lines from
output
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 The file on which the remainder of the non-matched lines is written
\b0 is used to invoke the cmp program on compressed files. All options specified are passed directly to cmp. If only 1 file is specified, then the files compared are file1 and an uncompressed file1.z. If two files are specified, then they are uncompressed (if ending with ".z") and fed to
\b cmp
\b0 . The exit status from
\b cmp
\b0 is preserved.
cmp_options
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\margl40
\margr40
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc0\cf0 Options to cmp
\b0 program on compressed files. All options specified are passed directly to
\b diff
\b0 . If only 1 file is specified, then the files compared are file1 and an uncompressed file1.z. If two files are specified, then they are uncompressed (if ending with ".z") and fed to